package com.xuyiwei.xblog.business.system.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.xuyiwei.xblog.business.system.model.Template;
import com.xuyiwei.xblog.business.system.dao.TemplateMapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.xuyiwei.xblog.business.system.service.ITemplateService;
import com.xuyiwei.xblog.core.base.constant.enums.TemplateKeyEnum;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 系统模板表 服务实现类
 * </p>
 *
 * @author xuyiwei
 * @since 2018-12-02
 */
@Service
public class TemplateServiceImpl extends ServiceImpl<TemplateMapper, Template> implements ITemplateService {

    @Override
    public Template getTemplate(TemplateKeyEnum key) {
        Template where = new Template();
        where.setRefKey(key.toString());
        Template template = baseMapper.selectOne(where);
        return template;
    }
}
